package chapter9;

import java.util.Scanner;

public class BankTest {
    public static void main(String[] args) {
        BankAccount account=new BankAccount("张三","adi021",10000);
        System.out.println("*** 欢迎使用本银行 ***");
        System.out.println("服务种类：");
        System.out.println("【1】查看余额");
        System.out.println("【2】取款");
        System.out.println("【3】存款");
        System.out.println("【0】退出");
        Scanner input=new Scanner(System.in);
        int choose=-1;

        do {
            System.out.println("请选择");
            choose=input.nextInt();
            switch (choose){
                case 1:
                    account.queryBalance();
                    break;
                case 2:
                    System.out.println("请输入取款金额");
                    int gmoney=input.nextInt();
                    account.withdrawal(gmoney);
                    break;
                case 3:
                    System.out.println("请输入存款金额");
                    int pmoney=input.nextInt();
                    account.deposit(pmoney);
                    break;
                case 0:
                    System.out.println("欢迎下次光临");
                    break;
                default:
                    System.out.println("输入有误重新输入");
            }
        }while (choose!=0);


    }
}
